﻿package mortal.game.view.chat
{
    import com.gengine.global.*;
    import com.gengine.keyBoard.*;
    import com.gengine.utils.*;
    import com.greensock.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.display.*;
    import com.mui.events.*;
    import extend.language.*;
    import fl.controls.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.utils.*;
    import mortal.common.*;
    import mortal.common.font.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.manager.msgTip.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.scene3D.map3D.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.utils.*;
    import mortal.game.view.chat.chatPrivate.*;
    import mortal.game.view.chat.chatTrumpet.*;
    import mortal.game.view.chat.chatViewData.*;
    import mortal.game.view.chat.data.*;
    import mortal.game.view.chat.selectPanel.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.button.*;
    import mortal.game.view.common.drag.*;
    import mortal.mvc.core.*;

    public class ChatModule extends View
    {
        private var _bg:ScaleBitmap;
        private var _chatBody:ChatBody;
        private var _bottomLine:Bitmap;
        private var _channelsTabBar:GTabBar;
        private var _tipBg:GImageBitmap;
        private var _spChannelsContainner:Sprite;
        private var _bmpInputBg:ScaleBitmap;
        private var _selectTypeButton:GButton;
        private var _inputPartContarner:Sprite;
        private var _enterButton:TimeButton;
        private var _expression:GLoadedButton;
        private var _textInput:TextInput;
        private var _shieldButton:GLoadedButton;
        private var _speakerButton:GLoadedButton;
        private var _clearButton:GLoadedButton;
        private var _setButton:GLoadedButton;
        private var _transButton:GLoadedButton;
        private var _resizeBtn:GLoadedButton;
        private var _PointBtn:GLoadedButton;
        private var _selectTypePanel:SelectTypePanel;
        private var _shieldTypePanel:ShieldTypePanel;
        private var _transPanel:TransSelectPanel;
        public var chatChannelsData:Array;
        public var judgeRec:Rectangle;
        private var tween:TweenMax;
        private var callTime:int = 0;
        private var _dragItem:DragItem;
        private var _arySize:Array;
        private var _iCurrentSize:int = 0;
        private var sizeArray:Array;
        public static const ChatWidth:Number = 283;

        public function ChatModule()
        {
            this.judgeRec = new Rectangle(0, 0, 283, 260);
            this._arySize = [188, 126, 63];
            this.sizeArray = [192, 120, 60];
            this.chatChannelsData = ChatMessageWorking.chatShowAreaData;
            this.mouseEnabled = false;
            this.init();
            return;
        }// end function

        private function init() : void
        {
            this.setSize(ChatWidth, 260);
            layer = LayerManager.uiLayer;
            this.initBg();
            this.initChatBody();
            this.initChannelsContainner();
            this.initInputPart();
            this.initFeaturesButton();
            this.initPanels();
            this.addEventListeners();
            StageMouseManager.instance.addRecEvent(this.judgeRec, this.overCallBack, this.outCallBack);
            return;
        }// end function

        protected function overCallBack() : void
        {
            clearTimeout(this.callTime);
            this.killTween();
            this.tween = TweenMax.to(this, 0.3, {chatAlpha:1});
            return;
        }// end function

        protected function outCallBack() : void
        {
            clearTimeout(this.callTime);
            this.callTime = setTimeout(this.tweenOut, 5000);
            return;
        }// end function

        protected function tweenOut() : void
        {
            this.killTween();
            this.tween = TweenMax.to(this, 1, {chatAlpha:0});
            return;
        }// end function

        protected function killTween() : void
        {
            if (this.tween)
            {
                this.tween.kill();
            }
            return;
        }// end function

        private function initBg() : void
        {
            this._bg = ResourceConst.getScaleBitmap("ChatPanelBg");
            this._bg.width = _width + 1;
            this._bg.height = _height - 39;
            this._bg.y = -_height;
            this._bg.x = -2;
            this.addChild(this._bg);
            this._bmpInputBg = UIFactory.bg(-1, -41, _width, 42, this, "ChatSendBg");
            return;
        }// end function

        private function initChatBody() : void
        {
            this._chatBody = new ChatBody(this.chatChannelsData);
            this._chatBody.y = -_height + 25;
            this.addChild(this._chatBody);
            return;
        }// end function

        private function initChannelsContainner() : void
        {
            var _loc_1:* = ParamsConst.instance.isYYPlan ? ("ChatYYTips.png") : ("ChatOtherTips.png");
            var _loc_2:* = -_height - (ParamsConst.instance.isYYPlan ? (56) : (39));
            this._tipBg = UIFactory.gImageBitmap(_loc_1, 0, _loc_2, this);
            this._spChannelsContainner = new Sprite();
            this._spChannelsContainner.y = -_height;
            this.addChild(this._spChannelsContainner);
            this._channelsTabBar = new GTabBar();
            this._channelsTabBar.x = 1;
            this._channelsTabBar.y = 4;
            this._channelsTabBar.buttonWidth = 36;
            this._channelsTabBar.buttonHeight = 23;
            this._channelsTabBar.horizontalGap = 0;
            this._channelsTabBar.buttonFilters = [FilterConst.nameGlowFilter];
            this._channelsTabBar.dataProvider = ChatMessageWorking.chatShowAreaData;
            this._spChannelsContainner.addChild(this._channelsTabBar);
            this._channelsTabBar.buttonStyleName = "ChatTabBtn";
            this._setButton = UIFactory.gLoadedButton(ImagesConst.ChatSet_upSkin, _width - 88, 5, 16, 17, this._spChannelsContainner);
            this._setButton.toolTipData = Language.getString(11600);
            this._speakerButton = UIFactory.gLoadedButton(ImagesConst.Speaker_upSkin, _width - 70, 5, 16, 17, this._spChannelsContainner);
            this._speakerButton.toolTipData = Language.getString(11601);
            this._clearButton = UIFactory.gLoadedButton(ImagesConst.ChatClearButton_upSkin, _width - 52, 5, 16, 17, this._spChannelsContainner);
            this._clearButton.toolTipData = Language.getString(11602);
            this._resizeBtn = UIFactory.gLoadedButton(ImagesConst.ChatResize_upSkin, _width - 34, 5, 16, 17, this._spChannelsContainner);
            this._resizeBtn.toolTipData = Language.getString(11603);
            UIFactory.gBitmap(ImagesConst.ChatExtend, _width - 14, 1, this._spChannelsContainner);
            this.addDragItem();
            return;
        }// end function

        private function addDragItem() : void
        {
            this._dragItem = new DragItem(15, 15);
            this._dragItem.x = _width - 15;
            this._spChannelsContainner.addChild(this._dragItem);
            this._dragItem.addEventListener(DragItemEvent.DragPositionChange, this._chatBody.onDragPositionChange);
            this._dragItem.addEventListener(DragItemEvent.StartDrag, this._chatBody.onStartDrag);
            return;
        }// end function

        private function initInputPart() : void
        {
            this._inputPartContarner = new Sprite();
            this._inputPartContarner.y = -37;
            this.addChild(this._inputPartContarner);
            this._PointBtn = UIFactory.gLoadedButton(ImagesConst.Point_upSkin, 2, 0, 18, 18, this._inputPartContarner);
            this._expression = UIFactory.gLoadedButton(ImagesConst.ExpressionButton_upSkin, 20, 0, 18, 18, this._inputPartContarner);
            this._selectTypeButton = UIFactory.gButton(ChatMessageWorking.chatChannelsData[0]["label"], 2, 17, 36, 18, this._inputPartContarner, "ChatBtn");
            this._selectTypeButton.paddingTop = 2;
            this._selectTypeButton.textFieldHeight = 18;
            this._enterButton = new TimeButton(ChatUtil.chatCd, TimeButton.CD, Cache.instance.cd.CHAT);
            this._enterButton.width = 45;
            this._enterButton.height = 31;
            this._enterButton.textField.filters = [FilterConst.glowFilter];
            this._enterButton.x = _width - 49;
            this._enterButton.y = 1;
            this._enterButton.label = "";
            this._enterButton.isByClick = false;
            this._enterButton.styleName = "EnterButton";
            this._inputPartContarner.addChild(this._enterButton);
            this._textInput = new GTextInput();
            this._textInput.width = _width - 96;
            this._textInput.textField.wordWrap = true;
            this._textInput.height = 40;
            this._textInput.x = 42;
            this._textInput.y = 0;
            this._textInput.maxChars = 50;
            this._textInput.restrict = "一-龥 -~·-=【】；‘、，。、.~！@#￥%……&*（）——+{}：’“”|《》？/*.‘’";
            this._textInput.textField.filters = [FilterConst.glowFilter];
            this._textInput.setStyle("upSkin", "");
            this._textInput.setStyle("focusRectSkin", "");
            this._inputPartContarner.addChild(this._textInput);
            var _loc_1:* = new GTextFormat(FontUtil.songtiName, 12, 16711372);
            _loc_1.leading = 0;
            this._textInput.setStyle("textFormat", _loc_1);
            return;
        }// end function

        private function initFeaturesButton() : void
        {
            return;
        }// end function

        private function initPanels() : void
        {
            this._selectTypePanel = new SelectTypePanel(ChatMessageWorking.chatChannelsData);
            this._selectTypePanel.x = this._selectTypeButton.x + 3;
            this._selectTypePanel.y = -146;
            return;
        }// end function

        private function addEventListeners() : void
        {
            this._channelsTabBar.addEventListener(MuiEvent.GTABBAR_SELECTED_CHANGE, this.changeTabBarChannelHandler);
            this._selectTypeButton.addEventListener(MouseEvent.CLICK, this.showSelectTypePanelHandler);
            this._enterButton.addEventListener(MouseEvent.CLICK, this.enterHandler);
            FacePanel.registBtn(this._expression, this.selectFace);
            this._selectTypePanel.addCall(this.changeSpeakChannel);
            this._textInput.addEventListener(KeyboardEvent.KEY_DOWN, this.downHandler);
            this._speakerButton.addEventListener(MouseEvent.CLICK, this.showSpeakerPanelHandler);
            this._PointBtn.addEventListener(MouseEvent.CLICK, this.onPointBtnClickHandle);
            this._clearButton.addEventListener(MouseEvent.CLICK, this.onClickClearHandler);
            this._setButton.addEventListener(MouseEvent.CLICK, this.onClickSetHandler);
            this._resizeBtn.addEventListener(MouseEvent.CLICK, this.onClickResizeHandler);
            Dispatcher.addEventListener(EventName.ChatResize, this.onResize);
            return;
        }// end function

        private function changeTabBarChannelHandler(event:MuiEvent = null) : void
        {
            this.changeSpeakChannel(this.chatChannelsData[this._channelsTabBar.selectedIndex]["name"]);
            this._chatBody.changToChatItem(this.chatChannelsData[this._channelsTabBar.selectedIndex]["name"]);
            if (this._channelsTabBar.selectedIndex == 2 || this._channelsTabBar.selectedIndex == 3)
            {
                EffectManager.glowFilterUnReg(this._channelsTabBar.getButtonAt(this._channelsTabBar.selectedIndex));
            }
            return;
        }// end function

        private function showSelectTypePanelHandler(event:MouseEvent) : void
        {
            if (this._selectTypePanel.parent)
            {
                this._selectTypePanel.parent.removeChild(this._selectTypePanel);
                this.removeStateCancelPanelEvent();
            }
            else
            {
                this.addChild(this._selectTypePanel);
                this.addStageCancelPanelEvent();
            }
            return;
        }// end function

        private function showShieldTypePanelHandler(event:MouseEvent) : void
        {
            if (this._shieldTypePanel.parent)
            {
                this._shieldTypePanel.parent.removeChild(this._shieldTypePanel);
                this.removeStateCancelPanelEvent();
            }
            else
            {
                this.addChild(this._shieldTypePanel);
                this.addStageCancelPanelEvent();
            }
            return;
        }// end function

        private function showTransHandler(event:MouseEvent) : void
        {
            if (this._transPanel.parent)
            {
                this._transPanel.parent.removeChild(this._transPanel);
                this.removeStateCancelPanelEvent();
            }
            else
            {
                this.addChild(this._transPanel);
                this.addStageCancelPanelEvent();
            }
            return;
        }// end function

        private function addStageCancelPanelEvent() : void
        {
            Global.stage.addEventListener(MouseEvent.CLICK, this.canselPanelsHandler);
            return;
        }// end function

        private function removeStateCancelPanelEvent() : void
        {
            if (!this._selectTypePanel.parent)
            {
                Global.stage.removeEventListener(MouseEvent.CLICK, this.canselPanelsHandler);
            }
            return;
        }// end function

        private function canselPanelsHandler(event:MouseEvent) : void
        {
            var _loc_2:* = event.target as DisplayObject;
            if (_loc_2 != this._selectTypeButton && _loc_2 != this._selectTypePanel)
            {
                if (this._selectTypePanel.parent)
                {
                    this._selectTypePanel.parent.removeChild(this._selectTypePanel);
                }
            }
            return;
        }// end function

        private function changeSpeakChannel(param1:String) : void
        {
            this._selectTypeButton.label = this.getLabelByName(param1);
            return;
        }// end function

        private function getLabelByName(param1:String) : String
        {
            var _loc_6:Object = null;
            var _loc_2:* = this._selectTypeButton.label;
            var _loc_3:* = ChatMessageWorking.chatShowAreaData;
            var _loc_4:* = _loc_3.length - 1;
            var _loc_5:int = 0;
            while (_loc_5 <= _loc_4)
            {
                
                _loc_6 = _loc_3[_loc_5];
                if (_loc_6["name"] == param1)
                {
                    _loc_2 = _loc_6["label"];
                    break;
                }
                _loc_5++;
            }
            return _loc_2;
        }// end function

        private function selectFace(param1:Object) : void
        {
            this._textInput.appendText("/" + param1.toString() + " ");
            this._textInput.setFocus();
            this._textInput.setSelection(this._textInput.text.length, this._textInput.text.length);
            return;
        }// end function

        private function selectTrans(param1:String) : void
        {
            var _loc_2:* = this._bg.width;
            var _loc_3:* = this._bg.height;
            switch(param1)
            {
                case TransSelectPanel.allTrans:
                {
                    this._bg.visible = false;
                    break;
                }
                case TransSelectPanel.partTrans:
                {
                    this._bg.visible = true;
                    this._bg.bitmapData = GlobalClass.getBitmapData("ChatPanelBg");
                    this._bg.width = _loc_2;
                    this._bg.height = _loc_3;
                    break;
                }
                case TransSelectPanel.littleTrans:
                {
                    this._bg.visible = true;
                    this._bg.bitmapData = GlobalClass.getBitmapData("ChatPanelBg");
                    this._bg.width = _loc_2;
                    this._bg.height = _loc_3;
                    break;
                }
                case TransSelectPanel.showPanel:
                {
                    this._chatBody.visible = true;
                    this._bg.visible = true;
                    this._spChannelsContainner.visible = true;
                    break;
                }
                case TransSelectPanel.hidePanel:
                {
                    this._chatBody.visible = false;
                    this._bg.visible = false;
                    this._spChannelsContainner.visible = false;
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        private function enterHandler(event:MouseEvent = null) : void
        {
            if (this._textInput.text != "" && this._enterButton.enabled)
            {
                this._enterButton.startCoolDown();
                Dispatcher.dispatchEvent(new DataEvent(EventName.ChatSend, {content:this._textInput.text, area:ChatMessageWorking.getNameByLabel(this._selectTypeButton.label)}));
            }
            else if (this._textInput.text == "")
            {
                Global.stage.focus = Global.stage;
                KeyBoardManager.instance.changeImeEnable(false);
            }
            return;
        }// end function

        public function setDefaultCountryChannel() : void
        {
            this._selectTypeButton.label = this.getLabelByName(ChatArea.Country);
            return;
        }// end function

        public function clearInput() : void
        {
            this._textInput.text = "";
            return;
        }// end function

        public function clearCD() : void
        {
            return;
        }// end function

        private function downHandler(event:KeyboardEvent) : void
        {
            if (this._textInput.text == "" && event.keyCode == KeyCode.UP)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.ChatCopyUpRecord));
            }
            if (event.keyCode == KeyCode.ENTER)
            {
                this.enterHandler();
            }
            event.stopImmediatePropagation();
            return;
        }// end function

        private function shrinkHandler(event:MouseEvent) : void
        {
            var _loc_2:String = this;
            _loc_2._iCurrentSize = this._iCurrentSize + 1;
            this._iCurrentSize = ++this._iCurrentSize >= this._arySize.length ? (0) : (this._iCurrentSize);
            this._chatBody.setSize(_width, this._arySize[this._iCurrentSize]);
            this._chatBody.y = -1 * (this._arySize[this._iCurrentSize] + 52);
            Dispatcher.dispatchEvent(new DataEvent(EventName.ChatResize));
            return;
        }// end function

        private function showSpeakerPanelHandler(event:MouseEvent) : void
        {
            var _loc_2:* = event.target as GButton;
            ChatTrumpetSendWindow.instance.show();
            return;
        }// end function

        private function onPointBtnClickHandle(event:MouseEvent) : void
        {
            this.addMapPoint();
            return;
        }// end function

        private function onClickClearHandler(event:MouseEvent) : void
        {
            this._chatBody.clearCurrentMsg();
            return;
        }// end function

        private function onClickSetHandler(event:MouseEvent) : void
        {
            var _loc_2:Point = null;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            if (ChatSetPanel.instance.isHide)
            {
                _loc_2 = this._setButton.localToGlobal(new Point(0, 0));
                _loc_3 = _loc_2.x;
                _loc_4 = _loc_2.y - 190;
                ChatSetPanel.instance.show(_loc_3, _loc_4);
                Global.stage.addEventListener(MouseEvent.CLICK, this.onClickStage);
            }
            else
            {
                ChatSetPanel.instance.hide();
                Global.stage.removeEventListener(MouseEvent.CLICK, this.onClickStage);
            }
            return;
        }// end function

        private function onClickResizeHandler(event:MouseEvent) : void
        {
            var _loc_2:* = this._chatBody.currentHeight;
            if (_loc_2 >= this.sizeArray[0])
            {
                _loc_2 = this.sizeArray[1];
            }
            else if (_loc_2 >= this.sizeArray[1])
            {
                _loc_2 = this.sizeArray[2];
            }
            else
            {
                _loc_2 = this.sizeArray[0];
            }
            this._chatBody.currentHeight = _loc_2;
            this.onResize();
            return;
        }// end function

        private function onClickStage(event:Event) : void
        {
            var _loc_2:* = event.target as DisplayObject;
            if (_loc_2 != this._setButton && !this._setButton.contains(_loc_2) && _loc_2 != ChatSetPanel.instance && !ChatSetPanel.instance.contains(_loc_2))
            {
                ChatSetPanel.instance.hide();
                Global.stage.removeEventListener(MouseEvent.CLICK, this.onClickStage);
            }
            return;
        }// end function

        private function onChoosePoint(param1:int, param2:Boolean) : void
        {
            if (param1 == Alert.OK)
            {
                this.addMapPoint();
            }
            if (param2)
            {
                PulseSharedObject.save("SelfMapPoint", true);
            }
            return;
        }// end function

        private function addMapPoint() : void
        {
            var _loc_1:* = new ChatShowPoint(MapFileUtil.mapID, RolePlayer.instance.x2d, RolePlayer.instance.y2d);
            this.addInputText(_loc_1.mapNameString());
            this.setChatInputFocus();
            Dispatcher.dispatchEvent(new DataEvent(EventName.ChatShowPoint, _loc_1));
            return;
        }// end function

        private function onGMClickHandler(event:MouseEvent) : void
        {
            var _loc_2:* = ParamsConst.instance.gmUrl;
            if (_loc_2 != null && _loc_2 != "")
            {
                BrowerUtil.getUrl(_loc_2);
            }
            else
            {
                GameManager.instance.popupModuleType(ModuleType.GM);
            }
            return;
        }// end function

        private function onResize(event:DataEvent = null) : void
        {
            this._bg.height = 29 + this._chatBody.currentHeight;
            this._bg.y = -1 * this._bg.height - 39;
            this._spChannelsContainner.y = -this._chatBody.currentHeight - 68;
            _height = -this._spChannelsContainner.y;
            var _loc_2:* = -_height - (ParamsConst.instance.isYYPlan ? (56) : (39));
            this._tipBg.y = _loc_2;
            return;
        }// end function

        public function get notShieldNameList() : Array
        {
            return [ChatArea.World, ChatArea.Country, ChatArea.Union, ChatArea.Team, ChatArea.Scene];
        }// end function

        public function updateChatMesssage(param1:ChatData) : void
        {
            var _loc_2:* = param1.typeArea;
            this._chatBody.addChatNotes(param1, this.notShieldNameList);
            if (_loc_2 == ChatArea.Union && this._channelsTabBar.selectedIndex != 2 && this.notShieldNameList.indexOf(_loc_2) >= 0)
            {
                EffectManager.glowFilterReg(this._channelsTabBar.getButtonAt(2), [FilterConst.chatTipsFilter], 0.6, 10, 1);
            }
            if (_loc_2 == ChatArea.Team && this.chatChannelsData.indexOf(ChatMessageWorking.teamObj) > -1 || _loc_2 == ChatArea.CrossGrop && this.chatChannelsData.indexOf(ChatMessageWorking.crossGroupObj) > -1 || _loc_2 == ChatArea.Force)
            {
                if (this._channelsTabBar.selectedIndex != 3 && this.notShieldNameList.indexOf(_loc_2) >= 0)
                {
                    EffectManager.glowFilterReg(this._channelsTabBar.getButtonAt(3), [FilterConst.chatTipsFilter], 0.6, 10, 1);
                }
            }
            return;
        }// end function

        public function updateTipMsg(param1:String, param2:String, param3:String = "complex", param4:int = 0, param5:Array = null, param6:int = 16777215) : void
        {
            this._chatBody.addTipNotes(param1, param2, param3, param4, param5, param6);
            return;
        }// end function

        public function addRumorMsg(param1:String, param2:Array, param3:String = null) : void
        {
            if (!param3)
            {
                param3 = ChatType.Legent;
            }
            this._chatBody.addRumorMsg(param1, param2, param3);
            return;
        }// end function

        public function addCopyMsg(param1:String, param2:Array) : void
        {
            var _loc_3:* = this._chatBody.addCopyMsg(param1, param2);
            if (this._channelsTabBar.selectedIndex != 4 && _loc_3 && ChatMessageWorking.chatChannelsData.indexOf(ChatMessageWorking.noTeamObj) > -1)
            {
                EffectManager.glowFilterReg(this._channelsTabBar.getButtonAt(4), [FilterConst.chatTipsFilter], 0.6, 10, 1);
            }
            return;
        }// end function

        public function addCrossCopyMsg(param1:String, param2:Array) : void
        {
            var _loc_3:* = this._chatBody.addCopyMsg(param1, param2, true);
            if (this._channelsTabBar.selectedIndex != 4 && _loc_3)
            {
                EffectManager.glowFilterReg(this._channelsTabBar.getButtonAt(4), [FilterConst.chatTipsFilter], 0.6, 10, 1);
            }
            return;
        }// end function

        public function addInputText(param1:String) : void
        {
            this._textInput.appendText(param1);
            return;
        }// end function

        public function setChatInputFocus() : void
        {
            this._textInput.setFocus();
            Global.instance.callLater(this.selectLastChat);
            return;
        }// end function

        public function selectLastChat() : void
        {
            this._textInput.setSelection(this._textInput.text.length, this._textInput.text.length);
            return;
        }// end function

        public function changeTabBar() : void
        {
            var _loc_1:* = GameMapUtil.isForceChatMap;
            ChatMessageWorking.changeToBattleField(_loc_1);
            var _loc_2:* = Cache.instance.group.isInGroup;
            var _loc_3:Boolean = false;
            var _loc_4:Boolean = false;
            ChatMessageWorking.changeGroup(_loc_3, _loc_4, _loc_2);
            this._selectTypePanel.updateData(ChatMessageWorking.chatChannelsData);
            this._channelsTabBar.dataProvider = ChatMessageWorking.chatShowAreaData;
            this._channelsTabBar.invalidate();
            this._channelsTabBar.drawNow();
            this.changeTabBarChannelHandler();
            return;
        }// end function

        public function updateVIPState() : void
        {
            return;
        }// end function

        override public function setSize(param1:Number, param2:Number) : void
        {
            super.setSize(param1, param2);
            this.judgeRec.width = param1;
            this.judgeRec.height = param2;
            ChatBody.lineWidth = _width - 23;
            return;
        }// end function

        override public function stageResize() : void
        {
            this.x = 0;
            this.y = SceneRange.display.height;
            this.judgeRec.y = SceneRange.display.height - this.judgeRec.height;
            return;
        }// end function

        override protected function updateView() : void
        {
            return;
        }// end function

        public function set chatAlpha(param1:Number) : void
        {
            this._bg.alpha = param1;
            this._spChannelsContainner.alpha = param1;
            this._chatBody.scrollAplha = param1;
            return;
        }// end function

        public function get chatAlpha() : Number
        {
            return this._spChannelsContainner.alpha;
        }// end function

        public function getChannelContainner() : Sprite
        {
            return this._spChannelsContainner;
        }// end function

        public function addSystemMsg(param1:String, param2:MsgTypeImpl) : void
        {
            this._chatBody.addSystemMsg(param1, param2);
            return;
        }// end function

        public function refresh() : void
        {
            this._chatBody.refresh();
            return;
        }// end function

        public function getTotalHeight() : int
        {
            return _height + (ParamsConst.instance.isYYPlan ? (56) : (39));
        }// end function

    }
}
